/**
 * @param {number[]} nums
 * @return {number}
 */
 var removeDuplicates = function(nums) {
    let left =0
 
  for(let i=1;i<nums.length;i++){
    if(nums[i]!=nums[left]){
      left++
      nums[left] = nums[i]
    }
  }
  return left
};

removeDuplicates([1,1,2])